package com.sz.biz.common.contract.service;

import com.sz.common.base.dao.ext.IEnum;

/**
 * Package: com.sz.biz.common.contract.service<br>
 * Function: TODO: ADD FUNCTION <br>
 * Author: yanhong.xiao.<br>
 * Date: 2017-07-19 19:56:00.
 */
public enum ServiceTypeEnum implements IEnum{

    SERVICE_LOGISTICS("1","物流"),

    SERVICE_TRADE("2","贸易");

    private String code;
    private String name;

    ServiceTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public static ServiceTypeEnum valueOfEnum(String code) {
        ServiceTypeEnum[] iss = values();
        for (ServiceTypeEnum cs : iss) {
            if (cs.getCode().equals(code)) {
                return cs;
            }
        }
        return null;
    }

    public static Integer getIntegerCode(ServiceTypeEnum typeEnum){
        return  Integer.valueOf(typeEnum.getCode());
    }
}
